﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
namespace FTchina.Api
{
    /// <summary>
    ///liuyan 的摘要说明
    /// </summary>
    public class liuyan
    {
        public liuyan()
        {
            //
            //TODO: 在此处添加构造函数逻辑
            //
        }
        /// <summary>
        /// 获取留言条目
        /// </summary>
        /// <param name="list">指定条目数</param>
        /// <param name="number">每行显示字符数</param>
        /// <param name="laststr">最后的字符，如……</param>
        /// <returns></returns>
        public static string GetList(int list, int number, string laststr)
        {
            if (FTchina.Caching.FTchinaCache.IsExits("GetliuyanList" + list + number + laststr))
            {
                return FTchina.Caching.FTchinaCache.GetCache("GetliuyanList" + list + number + laststr);
            }
            else
            {
                string tempwords = string.Empty;
                DataTable dt = shujuku.GetDataTable("select top "+list+" * from liuyan where ispass='已审核' order by id desc", "GetList");
                tempwords += "<ul class='nl'>";
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    tempwords += "<li><a href='liuyan.aspx#" + dt.Rows[i]["id"] + "'>" + basic.GetSubString(dt.Rows[i]["neirong"].ToString(), number, laststr) + "</a></li>";
                }
                tempwords += "</ul>";
                FTchina.Caching.FTchinaCache.AddCache("GetliuyanList" + list + number + laststr, tempwords);
                return tempwords;
            }
        }
    }
}